using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._LayersandTableViews
{
    /// <summary>
    /// <para>Make Table View</para>
    /// <para>Creates a table view from an input table or feature class. The table view that is created by the tool is temporary and will not persist after the session ends unless the document is saved.</para>
    /// <para>从输入表或要素类创建表视图。该工具创建的表视图是临时的，除非保存文档，否则会话结束后不会保留。</para>
    /// </summary>    
    [DisplayName("Make Table View")]
    public class MakeTableView : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public MakeTableView()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_table">
        /// <para>Input Table</para>
        /// <para>The input table or feature class.</para>
        /// <para>输入表或要素类。</para>
        /// </param>
        /// <param name="_out_view">
        /// <para>Table Name</para>
        /// <para>The name of the table view to be created.</para>
        /// <para>要创建的表视图的名称。</para>
        /// </param>
        public MakeTableView(object _in_table, object _out_view)
        {
            this._in_table = _in_table;
            this._out_view = _out_view;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Make Table View";

        public override string CallName => "management.MakeTableView";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_table, _out_view, _where_clause, _workspace, _field_info];

        /// <summary>
        /// <para>Input Table</para>
        /// <para>The input table or feature class.</para>
        /// <para>输入表或要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_table { get; set; }


        /// <summary>
        /// <para>Table Name</para>
        /// <para>The name of the table view to be created.</para>
        /// <para>要创建的表视图的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Table Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_view { get; set; }


        /// <summary>
        /// <para>Expression</para>
        /// <para>An SQL expression used to select a subset of records.</para>
        /// <para>用于选择记录子集的 SQL 表达式。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Expression")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _where_clause { get; set; } = null;


        /// <summary>
        /// <para>Output Workspace</para>
        /// <para>The input workspace used to validate the field names. If the input is a geodatabase table and the output workspace is a dBASE table, the field names may be truncated, since dBASE fields can only have names of ten characters or less.</para>
        /// <para>用于验证字段名称的输入工作空间。如果输入是地理数据库表，而输出工作空间是 dBASE 表，则字段名称可能会被截断，因为 dBASE 字段的名称只能不超过 10 个字符。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _workspace { get; set; } = null;


        /// <summary>
        /// <para>Field Info</para>
        /// <para>Specifies which fields from the input table to make visible in the output table view.</para>
        /// <para>指定要在输出表视图中显示输入表中的哪些字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Info")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _field_info { get; set; } = null;


        public MakeTableView SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}